SM=sm_13

new_hope_3_cleaned:
	@rm -fr kernel.so
	@cp include_${SM} include_current
	@nvcc -O3 kernel_$@.cu --ptxas-options=-v -c -arch ${SM}
	@nvcc -O3 kernel_$@.cu --ptxas-options=-v --ptx -arch ${SM}
	@rm kernel_$@.o
	@mv kernel_$@.ptx ptx
	@nvcc --compiler-options="-fPIC" -O3 --shared kernel_$@.cu -o kernel.so -arch ${SM}
	@rm -fr include_current

callgrind:
	valgrind --tool=callgrind --dump-instr=yes --trace-jump=yes --simulate-cache=yes --simulate-wb=yes --simulate-hwpref=yes  ./a.out

cachegrind:
	valgrind --tool=cachegrind ./a.out

memcheck:
	valgrind --tool=memcheck --leak-check=full ./a.out

